"""编写字典
info ={}
k = input("输入key:")
v = input("请输入value:")
info[k]=v
print(info)
"""
"""循环打印直到有错误
while True:
    info = {}
    k = input("键：")
    v = input("值：")
    info[k] = v
    if k=="N":
        print("错误")
        break
    else:
        continue
        """
"""
messsage = "k1|v1,k2|v2,k3|v3"
v1 = messsage.split(",")
info = {}
key = info.keys()
values = info.values()
for item in v1:
    v2,v3 =item.split("|")#这个是将拆分的字符串分别赋值给v2,v3
    print(v2,v3)
    info[v2]=v3#增加字典元素
print(info)
"""
users_list = []
while True:
    u = input("请输入用户:")
    p = input("请输入密码:")
    v = {}
    v["user"] = u
    v["pwd"] = p
    users_list.append(v)
    if u == "N" or p == "n":
        print("错误！")
        break
print(users_list)
user_name = input('请输入用户名:')
passwd = input("请输入密码:")
message="登陆失败"
for item in users_list:
    if user_name == item["user"] and passwd == item["pwd"]:
        message="欢迎登陆！"
        break
print(message)

